package com.skyblue.relation.action;


import com.opensymphony.xwork2.ActionSupport;
import com.skyblue.relation.domain.Department;
import com.skyblue.relation.domain.Employee;
import com.skyblue.relation.service.DepartmentService;

public class AddDepartment extends ActionSupport{
	private DepartmentService departmentService;
	private String name;
	private String tel;
	public DepartmentService getDepartmentService() {
		return departmentService;
	}
	public void setDepartmentService(DepartmentService departmentService) {
		this.departmentService = departmentService;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getTel() {
		return tel;
	}
	public void setTel(String tel) {
		this.tel = tel;
	}	
	public String execute()  {
		System.out.println("实例化一个部门");
		Department department =new Department();
		department.setName(name);
		department.setTel(tel);
		departmentService.addDepartment(department);
		return SUCCESS;
	}
	
}
